﻿$(function () {
    $("#records").ggrid({
        url: '/PressReleases/GridLoad',
        dataType: 'json',
        columns: [
		    { display: 'Title', name: 'Title', width: 40, sortable: true, align: 'left' },
		    { display: 'Release Date', name: 'ReleaseDate', width: 180, sortable: true, align: 'left', formatFunction: formatDate }
		],
        actions: [
		    { idColumn: 'ID', image: '/Content/images/pencil.png', action: '/PressReleases/Create/{0}', showConfirm: false },
		    { idColumn: 'ID', image: '/Content/images/cross.png', action: '/PressReleases/Delete/{0}', showConfirm: true }
		],
        defaultSort: "ReleaseDate",
        defaultSortOrder: "desc",
        usePaging: true,
        pageSize: 10,
        width: 'auto',
        height: 'auto'
    });
});